<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>todolist</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <input v-model="inputValue"/>
        <button @click="handleSubmit">提交</button>
        <ul>
            <li v-for="value in values"> {{value}}</li>
        </ul>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                inputValue:"hello",
                values:[]
            },
            methods:{
                handleSubmit: function() {
                    this.values.push(this.inputValue);
                    this.inputValue = "";
                }
            }

        })
    </script>
</body>
</html>